import http from './axios'
export const fetchProducts = (params = {}) => {
  return http.get('/api/products', { params });
};

export const createProduct = (product) => {
  return http.post('/api/products', product);
};

export const updateProduct = (id, updates) => {
  return http.patch(`/api/products/${id}`, updates);
};

export const deleteProduct = (id) => {
  return http.delete(`/api/products/${id}`);
};

export const updateStock = (id, stock) => {
  return http.patch(`/api/products/${id}/stock`, { stock });
};